package com.miyake.loveviewweb.client.editor;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import com.miyake.loveviewweb.client.dialog.DialogHandler;
import com.miyake.loveviewweb.client.dialog.IDialogPanel;

public class ArrayEditor extends Composite implements HasText, IDialogPanel {

    private static ArrayEditorUiBinder uiBinder = GWT
        .create(ArrayEditorUiBinder.class);
    @UiField HTMLPanel panel;
    @UiField TextBox textName;
    @UiField TextArea textArea;

    interface ArrayEditorUiBinder extends UiBinder<Widget, ArrayEditor> {
    }

    public ArrayEditor() {
        initWidget(uiBinder.createAndBindUi(this));
    }

    public ArrayEditor(String firstName) {
        initWidget(uiBinder.createAndBindUi(this));
        setText(firstName);
    }

    public void setText(String text) {
        this.textName.setText(text);
    }

    public String getText() {
        return textName.getText();
    }

    public String getTextData() {
        return this.textArea.getText();
    }

    public void setDialogHandler(DialogHandler handler) {
        // TODO Auto-generated method stub
        
    }

    public Composite getComposite() {
        return this;
    }

}
